import { rules } from "../naiveui/types";

// 基础组件
export const basicComponents = [
	{
		label: "单行文本",
		type: "input",
		options: {
			width: "100%",
			defaultValue: "",
			placeholder: "",
			maxlength: null,
			prefix: "",
			suffix: "",
			addonBefore: "",
			addonAfter: "",
			disabled: false,
			allowClear: false,
			readonly: false,
			rules,
		},
	},
	{
		label: "密码框",
		type: "password",
		options: {
			width: "100%",
			defaultValue: "",
			placeholder: "",
			maxlength: null,
			prefix: "",
			suffix: "",
			addonBefore: "",
			addonAfter: "",
      showPasswordOn: 'click',
			visibilityToggle: true,
			disabled: false,
			allowClear: false,
			readonly: false,
			rules,
		},
	},
	{
		label: "多行文本",
		type: "textarea",
		options: {
			width: "100%",
			defaultValue: "",
			placeholder: "",
			maxlength: null,
			rows: 4,
			autoSize: false,
			showCount: false,
			disabled: false,
			allowClear: false,
			readonly: false,
			rules,
		},
	},
	{
		label: "计数器",
		type: "number",
		options: {
			width: "",
			defaultValue: 0,
			min: 0,
			max: 100,
			step: 1,
			readonly: false,
			disabled: false,
			rules,
		},
	},
	{
		label: "单选框组",
		type: "radio",
		options: {
			defaultValue: "",
      type: 'radio',
			width: "",
			inline: true,
			remote: false,
			showLabel: true,
			remoteFunc: "/admin/system/dictData/findListByType?key=sys_org_type",
			options: [
				{
					value: "Option 1",
					label: "Option 1",
				},
				{
					value: "Option 2",
					label: "Option 2",
				},
				{
					value: "Option 3",
					label: "Option 3",
				},
			],
			remoteOptions: [],
			props: {
				value: "value",
				label: "label",
			},
			disabled: false,
			rules,
		},
	},
	{
		label: "多选框组",
		type: "checkbox",
		options: {
			defaultValue: [],
			width: "",
			inline: true,
			remote: false,
			showLabel: true,
			remoteFunc: "/admin/system/dictData/findListByType?key=sys_org_type",
			options: [
				{
					label: "Option 1",
					value: "Option 1",
				},
				{
					label: "Option 2",
					value: "Option 2",
				},
				{
					label: "Option 3",
					value: "Option 3",
				},
			],
			remoteOptions: [],
			props: {
				value: "value",
				label: "label",
			},
			disabled: false,
			rules,
		},
	},
	{
		label: "时间选择器",
		type: "time",
		options: {
			defaultValue: undefined,
			width: "",
			placeholder: "请选择时间",
			format: "HH:mm:ss",
			valueFormat: undefined,
			readonly: false,
			allowClear: true,
			disabled: false,
			rules,
		},
	},
	{
		label: "日期选择器",
		type: "date",
		options: {
			defaultValue: undefined,
			width: "",
			placeholder: "请选择时间",
			format: "YYYY-MM-DD",
			valueFormat: "",
			readonly: false,
			allowClear: true,
			disabled: false,
			rules,
		},
	},
	{
		label: "评分",
		type: "rate",
		options: {
			defaultValue: null,
			max: 5,
			allowClear: true,
			allowHalf: false,
			disabled: false,
			rules,
		},
	},
	{
		label: "下拉选择框",
		type: "select",
		options: {
			defaultValue: [],
			width: "200px",
			mode: null,
			placeholder: "",
			remote: false,
			showLabel: true,
			showSearch: false,
			clearable: false,
			disabled: false,
			props: {
				label: "label",
				value: "value",
			},
			options: [
				{
					label: "Option 1",
					value: "Option 1",
				},
				{
					label: "Option 2",
					value: "Option 2",
				},
				{
					label: "Option 3",
					value: "Option 3",
				},
			],
			remoteOptions: [
				{
					label: "Option 1",
					value: "Option 1",
				},
			],
			ajax: true,
			remoteFunc: "/admin/system/dictData/findListByType?key=sys_org_type",
			rules,
		},
	},
	{
		label: "开关",
		type: "switch",
		options: {
			defaultValue: false,
			disabled: false,
			checkedChildren: "",
			unCheckedChildren: "",
			rules,
		},
	},
	{
		label: "滑块",
		type: "slider",
		options: {
			defaultValue: 0,
			width: "",
			min: 0,
			max: 100,
			step: 1,
			disabled: false,
			range: false,
			reverse: false,
			rules,
		},
	},
	{
		label: "文字",
		type: "text",
		options: {
			defaultValue: "This is a text",
		},
	},
];
